package com.example.xadmin.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2020-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_role")
public class SysRole implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    @TableField(NAME)
    private String name;

    @TableField(DESCRIPTION)
    private String description;

    @TableField(value = CREATETIME,fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = UPDATETIME,fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    public static final String ID = "`id`";

    public static final String NAME = "`name`";

    public static final String DESCRIPTION = "`description`";

    public static final String CREATETIME = "`createTime`";

    public static final String UPDATETIME = "`updateTime`";


    public static final String ID_COMMENT = "";

    public static final String NAME_COMMENT = "";

    public static final String DESCRIPTION_COMMENT = "";

    public static final String CREATETIME_COMMENT = "";

    public static final String UPDATETIME_COMMENT = "";



    public static SysRole of(Object obj) {
        SysRole e = new SysRole();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<SysRole> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
